<!DOCTYPE HTML><html>
<head>
<? echo $h->meta($title, $kwd, $dpn); ?>
<? require_once("lib.php"); ?>
<script src="<?=$ecom?>/js/jquery.validate.js" type="text/javascript"></script>
<script src="<?=$ecom?>/js/jquery.metadata.js" type="text/javascript"></script>
</head>
<body id="">
<? include_once("header.php"); ?>
<div id="wrap">
	<div class="breadcrumb">
		<a href="./"><?=WEB_INDEX_PAGE?></a> &gt; <span><?=$cate_name?></span>
	</div><!--breadcrumb end-->
	<div id="login" class="">
		<div class="login">
			<div class="left"><img src="<?=$ecom?>/images/login_show.jpg" /></div>
			<div class="login_box right"><div class="login_boxer">
				<form method="post" class="need_check">
					<h2><?=$cate_name?></h2>
					<? 
					// 签名以过滤非法提交表单
					$key=md5('ecomgear'.date('Ymd'));
					echo $h->hidden('key',$key);
					if($do=='view'){
					echo $h->hidden('action','find');?>
					<table width="100%">
						<tr><td width="140" class="tright"><span class="error">*</span> <?=WEB_EMAIL?>: </td><td><input type="text" value="" class="g {validate:{required:true, email:true, messages:{required:'<?=WEB_EMAIL_REQUIRED?>', email:'<?=WEB_INVALID_EMAIL?>'}}}" name="email" /></td></tr>
						<tr><td class="tright"><span class="error">*</span> <?=WEB_CAPTCHA?>: </td><td><input type="text" class="gs" name="code" /> &nbsp; <img src="api_ver_code.php" width="72" /><span class="error"></span></td></tr>
						<tr><td>&nbsp;</td><td><input type="submit" class="hand button_blue" value="<?=WEB_SUBMIT?>" />
						</td></tr>
					</table>
					<script type="text/javascript">
						jQuery.validator.addMethod("ver_code", function(value, element) {
					var flag = 0;
					if(value.length < 4) return true;
					$.ajax({
						type:"GET", url:'ajax_ver_code.php', async:false,
						data:{'code':value},
						success: function(msg){ if(msg == 'yes'){ flag = 1; } }
					});
					if(flag == 0) return false; else return true;
					}, "<?=WEB_INPUT_ERROR?>");

				  	$(".need_check").validate({meta: "validate",
				  		rules:{
				  			email:{required:true,email:true},
				  			code:{required:true,ver_code:true}
				  		},
				  		messages:{
				  			email:{
				  				required:'<?=WEB_EMAIL_REQUIRED?>',
				  				email:' <?=WEB_INVALID_EMAIL?> '
				  			},
				  			code:{required:'<?=WEB_CAPTCHA_REQUIRED?>'
				  			}
				  		},
						onkeyup: false,
						errorPlacement: function( label, element ) {
							element.parent().append("<br>").append(label);
						}
				  });</script>

					<? } if($do=='code'){
					echo $h->hidden('action','pass');
					echo $h->hidden('email',$tem_email); 
					?>
					<table width="100%">
						<tr><td width="140" class="tright"><span class="error">*</span> <?=WEB_EMAIL?>: </td><td><input disabled type="text" value="<?=$tem_email?>" class="g" name="email2" /></td></tr>
						<tr><td class="tright"><span class="error">*</span> <?=WEB_VERIFICATION_CODE?>: </td><td><input type="text" class="g {validate:{required:true, messages:{required:'<?=WEB_REQUIRED?>',}}}" name="code" /> <a class="blue" href="forgot_password.php?do=view">(<?=WEB_REFRESH?>)</a></td></tr>
						<tr><td>&nbsp;</td><td><input type="submit" class="hand button_blue" value="<?=WEB_SUBMIT?>" />
						</td></tr>
					</table>
					<script type="text/javascript">
					  $(document).ready(function(){
					  	$(".need_check").validate({meta: "validate", onkeyup: false,
							errorPlacement: function( label, element ) {
								element.parent().append("<br>").append(label);
							}
						});
					});
					</script>

					<? } if ( $do=='edit' ){
						echo $h->hidden('action','update');
					echo $h->hidden('email',$tem_email);  ?>
					<table>
					<tr><td width="140" class="tright"><span class="error">*</span> <?=WEB_EMAIL?>: </td><td><input disabled value="<?=$tem_email?>" type="text" class="g" name="email2" /></td></tr>
					<tr><td class="tright"><span class="error">*</span> <?=WEB_NEW_PASSWORD?>: </td><td><input type="password" id="password" class="g {validate:{required:true, minlength:6, messages:{required:'<?=WEB_PASSWORD_REQUIRED?>', minlength:'<? printf(WEB_PASSWORD_MIN_LENGTH,6)?>'}}}" name="password" /></td></tr>
					<tr><td class="tright"><span class="error">*</span> <?=WEB_CONFIRM_PASSWORD?>: </td><td><input type="password" class="g {validate:{required:true, equalTo:'#password', messages:{required:'<?=WEB_CONFIRM_PASSWORD_REQUIRED?>',equalTo:'<?=WEB_PASSWORD_AND_CONFIRM_PASSWORD_MISMATCH?>'}}}" name="repassword" /></td></tr>
					<tr><td>&nbsp;</td><td><input type="submit" class="button_blue" value="<?=WEB_SUBMIT?>" />
					</td></tr>
				</table>
				<script type="text/javascript">
					  $(document).ready(function(){
					  	$(".need_check").validate({meta: "validate", onkeyup: false, 				
							errorPlacement: function( label, element ) {
								element.parent().append("<br>").append(label);
							}
						});
					});
					</script>
					<? } ?>
				</form>
				<div class="clear"></div>
			</div></div>
		</div>
	</div><!--#register-->
		<div class="clear"></div>
	<div class="px20"></div>
	<div class="clear"></div>
</div>
<? include("footer.php"); ?>
</body>
</html>